
sum = 0 # 小明手里的钱
age = 20 # 小明的年龄
X = int(input())
M = int(input()) 

while age < 80 and sum < M : # and 代表并且，and 和 or 可以连接多个条件
        age = age + 1
        sum = sum + X
        X = X*1.08 # 工资涨幅
        M = M*1.1  # 房价涨幅

if sum >= M:
        print("小明在",age,"岁的时候能买到房子")
else:
        print("小明在有生之年买不到房子")
